package homework3.test;

import java.io.File;
import java.io.IOException;

/**
 * @author fengq
 */
public class FileMethods {
    public static void main(String[] args) throws IOException {
        FileMethods fileMethods = new FileMethods();
        File file = new File("D:\\Test1.txt");
        fileMethods.create(file);
        fileMethods.delete(file);
    }

    public void create(File file) throws IOException {
        if (!file.exists()){
            file.createNewFile();
        }
    }

    public void delete(File file){
        if(file.exists()){
            file.delete();
        }
    }
}
